Returning multiple results from one row [migrated]

Posted by krock on Programmers See other posts from Programmers or by krock
Published on 2012-10-30T07:29:44Z Indexed on 2012/10/30 11:19 UTC
Read the original article Hit count: 208

Filed under:

I have a set of MySQL data similar to the following:

| id | type       | start      | end        |
=============================================
|  1 |      event | 2011-11-01 | 2012-01-02 |
|  2 |    showing | 2012-11-04 | 2012-11-04 |
|  3 | conference | 2012-12-01 | 2012-12-04 |
|  4 |      event | 2012-01-01 | 2012-01-01 |

I want to retrieve events within a certain date range, but I also want to return individual results for each row that has a time span of more than one day. What's the best way to achieve this?

Using PHP is a possibility, but I wanted to avoid doing this because I will need to to take pagination into account, etc.

Any ideas would be greatly appreciated.

© Programmers or respective owner

Related posts about mysql